<?php
namespace App\Wen\Utils;

class FieldUtils{
    /**
     * 返回前端的用户字段
     */
    public static function userInfoColums(){
        return ['id', 'user_name', 'anonymous_name', 'user_avatar', 'anonymous_avatar', 'user_introduce','user_birthday', 'user_background_maps', 'is_authentication', 'is_member', 'is_official', 'gender', 'country_code','phone', 'real_name', 'wechat_account', 'university', 'invite_benefit_layer', 'club_id', 'shop_id', 'user_state', 'shop_id','country', 'province', 'city', 'district','longitude', 'latitude', 'weixin_unionid','is_robot', 'created_at'];
    }

    public static function commentInfoColums(){
        return ['id', 'posts_id', 'posts_user_id', 'user_id', 'user_name', 'user_avatar', 'comment_agent_id', 'comment_agent_name', 'comment_agent_avatar', 'comment_content', 'comment_img_url', 'comment_id', 'is_anonymous', 'is_sticky', 'is_only_text', 'comment_state', 'device', 'created_at', 'updated_at', 'country', 'province', 'city', 'district'];
    }

    public static function postInfoColums(){
        return ['id', 'posts_title', 'posts_content', 'user_id', 'pay_content_id','refer_id', 'circle_id', 'circle_name', 'post_type', 'address_id', 'useds', 'bureaus', 'tags_id', 'files_id', 'sounds_id', 'video_id', 'goods_id', 'vote_id', 'voter_id', 'has_fields', 'img_count', 'swiper_max_height', 'is_wechat_sph', 'is_anonymous', 'is_only_text', 'is_information', 'is_examine', 'overrule_content', 'overrule_is_read', 'posts_state', 'device', 'is_sticky', 'is_reward', 'is_blur', 'weight', 'degree', 'last_reply_at', 'created_at', 'updated_at', 'country', 'province', 'city', 'district', 'tenant_id', 'tenant_obj'];
    }

    public static function circleInfoColums(){
        return  ['id', 'circle_name', 'head_portrait', 'circle_introduce', 'background_maps', 'plate_id', 'user_id', 'is_follow_vip', 'is_follow_authentication', 'is_follow_admin', 'is_follow_pay', 'follow_pay_num', 'follow_pay_credit', 'follow_pay_duration', 'count_comment', 'count_pay_content', 'count_circle_posts', 'count_circle_follow', 'is_tenant_select', 'is_city_select'];
    }


    public static function shopClassifyColums(){
        return ['id', 'name', 'depth', 'pic', 'bg_img', 'parent_id', 'guarantee', 'is_shop_type1', 'is_shop_type2', 'is_shop_type3', 'is_shop_type4'];
    }

    public static function shopInfoColums(){
        return  ['id', 'user_id', 'admin_user_id', 'shop_logo', 'shop_name', 'shop_type', 'margin_rest', 'shop_credit_score', 'margin_least', 'status', 'head_name', 'head_id_card_num'];
    }

    public static function userPermissions($action = 'publish_post', $need_ten = false){
        $list = [
            0 => '普通用户',
            1 => '认证用户',
            2 => '会员',
            3 => '管理员',
            4 => 'lv1',
            5 => 'lv2',
            6 => 'lv3',
            7 => 'lv4',
            8 => 'lv5',
            9 => 'lv6',
        ];
        if($action == 'user_authenticate'){
            unset($list[1]);
        }
        if($need_ten){
            $list[10] = '自定义用户';
        }
        return $list;
    }

    public static function selectUsers(){
        return [
            0 => '所有用户',
            1 => '在线用户',
            2 => '认证用户',
            3 => '会员用户',
            4 => '指定用户'
        ];
    }

    public static function getUrlTypes(){
        return [
            0 => '0. 链接',
            1 => '1. 笔记',
            2 => '2. ' . env('circle_call', '圈子'),
            3 => '3. 商品',
            4 => '4. 用户',
            5 => '5. 话题',
            6 => '6. 路径',
            7 => '7. 商品分类',
            8 => '8. 帮助问题',
            9 => '9. 扫一扫',
            10 => '10. webview',
            11 => '11. 三方小程序',
            12 => '12. 名片',
            13 => '13. js函数',
            14 => '14. 视频号主页',
            15 => '15. 视频号视频',
            16 => '16. 视频号直播',
            17 => '17. 复制',
            18 => '18. 聊天',
            19 => '19. 半屏小程序',
            20 => '20. 图集',
            21 => '21. 图集主题',
            22 => '22. 打电话',
            24 => '24. 弹窗图片',
            25 => '25. toast',
            26 => '26. 预览图片',
            27 => '27. 企业微信-客服',
            28 => '28. 闲置商品',
            29 => '29. 闲置分类',
            30 => '30. 打开地图',
            31 => '31. 弹窗图标',
            32 => '32. 店铺',
            33 => '33. 选票活动',
            34 => '34. 组局活动',
            35 => '35. 俱乐部',
            36 => '36. 模态弹窗'
        ];
    }

    public static function getQuestionTypes(){
        return [
            0 => '常见问题',
            1 => '小程序问题',
            2 => 'App问题',
            3 => '账号问题',
            4 => '进阶指南',
            5 => '新手必看',
            6 => '认证相关',
            7 => env('circle_call', '圈子').'相关',
            8 => '付费相关',
            9 => '其他问题',
            10 => Settings::get('app_coin_name', '硬币').'相关',
            11 => 'MINI相关',
            12 => '模块相关',
            13 => '证照资质',
            14 => '本站相关',
            15 => '官方相关',
            16 => '还有需求找群主',
            17 => '商户相关'
        ];
    }

    public static function getGiftTypes($type = 'default'){
        if( $type == 'luckdraw' ){
            return [
                0 => Settings::get('app_coin_name', '硬币').'(枚)',
                1 => '余额(￥)',
                2 => '会员(天)',
                3 => '商品(模块)'
            ];
        }else{
            return [
                0 => Settings::get('app_coin_name', '硬币').'(枚)',
                1 => '余额(￥)',
                2 => '会员(天)',
            ];
        }
    }

    public static function getPayTypes(){
        return [
            0 => Settings::get('app_coin_name', '硬币').'购买',
            1 => '余额购买',
            2 => '会员免费',
            3 => '激励视频',
            4 => '每日免费',
            5 => '微信支付',
            6 => '支付宝支付'
        ];
    }

    public static function getOrderTypes(){
        return [0 => '未定义', 1 => '会员', 2 => '充电', 3=>'充值', 4 => '购买付费笔记', 6 => '笔记付费推广', 7=>'加入付费'.env('circle_call', '圈子'), 8=>'店铺保证金充值', 9 =>'购买模块'];
    }

    public static function getUserFinancialType(){
        return [
            0 => '收到充电',
            1 => '抽奖奖励',
            2 => '余额提现',
            3 => '商品退款',
            4 => '签到奖励',
            5 => '任务奖励',
            6 => '余额充值',
            7 => '购买付费笔记',
            8 => '付费关注'.env('circle_call', '圈子'),
            9 => '付费按次发布',
            10 => '充电了笔记',
            11 => '开通会员',
            12 => '付费笔记被购买',
            13 => '商品订单结算',
            14 => env('circle_user_call', '圈主').'分成奖励',
            15 => '一级团队成员奖励',
            16 => '二级团队成员奖励',
            17 => '三级团队成员奖励',
            18 => '管理员增加',
            19 => '管理员减少',
            20 => '商品分账',
            21 => '笔记付费推广',
            22 => '加入付费'.env('circle_call', '圈子'),
            23 => '付费加入'.env('circle_user_call', '圈主').'奖励',
            24 => '推广用户即时收益',
            25 => '闲置商品收入',
            26 => '商品被购买',
            27 => '购买程序模块',
            28 => '组局活动订单结算',
            29 => '组局活动订单退款',
            30 => '解除账号限制',
            31 => '获取联系方式向我付费',
            32 => '付费获取Ta人联系方式',
            33 => '笔记自动刷新退款',

            // DESAI 相关余额变动类型
            10001 => '购买了模型',
            10002 => '模型被购买',
        ];
    }

    public static function getUserCoinType(){
        return [
            0 => '未知',
            1 => '购买付费',
            2 => '内容被购买',
            3 => Settings::get('app_coin_name', '硬币').'抵扣',
            4 => Settings::get('app_coin_name', '硬币').'抵扣退款',
            5 => '付费关注'.env('circle_call', '圈子'),
            6 => '付费'.env('circle_call', '圈子').'发布',
            7 => '签到奖励',
            8 => '任务奖励',
            9 => '抽奖奖品',
            10 => '激励视频奖励',
            11 => '发帖奖励',
            12 => '评论奖励',
            13 => '会员赠送'.Settings::get('app_coin_name', '硬币'),
            14 => Settings::get('app_coin_name', '硬币').'抽奖',
            15 => env('circle_user_call', '圈主').'分成奖励',
            16 => '购买头像框',
            17 => '管理员操作',
            18 => '投币笔记',
            19 => '获得投币',
            20 => '付费加入'.env('circle_call', '圈子'),
            21 => '付费加入'.env('circle_user_call', '圈主').'奖励',
            22 => '推广用户即时收益',
            23 => '兑换'.Settings::get('app_coin_name', '硬币').'商品',
            24 => '兑换商品被购买',
            25 => '组局活动订单结算',
            26 => '组局活动订单退款',
            27 => '兑换商品退款',
            28 => '重新编辑笔记',



            // DESAI 相关余额变动类型
            10001 => '购买了模型',
            10002 => '模型被购买',
            99999 => '其他'
        ];
    }

    public static function getNoticeTypes(){
        return [
            100 => '系统通知',
            101 => '赞和收藏',
            102 => '评论和@',
        ];
    }

    public static function getTaskTypes(){
        return [
            0 => '每日任务',
            1 => '成长任务'
        ];
    }

    public static function getOnceTaskTypes(){
        return [
            0 => '认证用户（一次性）',
            1 => 'App登录（一次性）',
            2 => '签到总次数',
            3 => '抽奖总次数',
            4 => '拥有签名（一次性）',
            5 => '发表笔记数',
            6 => '评论数',
            7 => '喜欢笔记',
            8 => '笔记被喜欢',
            9 => '粉丝量',
            10 => '使用小程序（一次性）',
            11 => '充电总额',
            12 => '被充电总额',
            13 => '拥有'.Settings::get('app_coin_name', '硬币').'（一次性）',
            14 => '成为Vip（一次性）',
//            15 => '上传一次头像（未实现）',
//            16 => '上传一次背景（未实现）',
            17 => '完成任务数量',
            18 => '邀请人数总数',
            19 => '完成注册（一次性）',
            20 => '激励总次数',
            21 => '参与组局总次数'
        ];
    }

    public static function getDayTaskTypes(){
        return [
            0 => '每日签到',
            1 => '每日抽奖',
            2 => '每日登录',
            3 => '发布笔记',
            4 => '评论笔记',
            5 => '喜欢笔记',
            6 => '充电笔记',
            7 => '踩ta主页（未实现）',
            8 => '邀请好友注册',
            9 => '今日激励次数'
        ];
    }

    public static function getShopGoodTypes($shop = true){
        // 6: 闲置 7: 组局
        if($shop){
            return [
                0 => '实体',
                1 => '淘客',
                2 => '虚拟',
                3 => '下载（未开放）',
                4 => '卡密',
                5 => '核销',
            ];
        }else{
            return [
                6 => '闲置',
                7 => '组局',
            ];
        }
    }

    public static function getReportTypes(){
        return [
            0 => '欺诈',
            1 => '色情政治',
            2 => '诱导行为',
            3 => '强制关注行为',
            4 => '传播不实信息',
            5 => '违法犯罪',
            6 => '骚扰',
            7 => '违规营销',
            8 => '侵权',
            9 => '广告',
            10 => '图片不适',
            11 => '其他'
        ];
    }

    public static function getPageTypes(){
        return [
            0 => '滑动Tab页面-样式一',
            1 => '滑动Tab页面-样式二',
            2 => '菜单-样式一',
            3 => '群二维码'
        ];
    }

    public static function getExperienceTypes(){
        return [
            0 => '在线1分钟',
            1 => '发布笔记',
            2 => '笔记讨论',
            3 => '喜欢笔记',
            4 => '收藏笔记',
            5 => '点赞评论',
            6 => '关注'.env('circle_call', '圈子'),
            7 => '开启聊天',
            8 => '关注用户',
            9 => '提交反馈',
            10 => '添加购物车',
            11 => '添加分区',
            12 => '投币',
            13 => '机器人模拟在线',
            14 => '系统汇总',
            15 => '发布闲置',
            16 => '发布选票',
            17 => '发布组局',
            18 => '学生认证',
            19 => '参加选票',
            20 => '申请俱乐部'
        ];
    }

    public static function getAttachmentTypes(){
        return [ "jpg", "jpeg", "png", "gif",  "mp4", 'mp3', "zip", 'rar', 'txt', 'doc', 'xls', 'ppt', 'pdf', 'docx', 'xlsx', 'pptx', 'webp'];
    }

    public static function usedGoodState(){
        return [0=>'待审核', 1=>'推送中', 2=>'提前下架', 3=>'交易完成', 4=>'驳回', 5=>'买家已付款', 6=>'买家已退款', 7=>'买家待付款', 99=>'管理员已下架'];
    }

}
